﻿using SD.Infrastructure.Repository.EntityFrameworkCore;
using SlamDunk.MES.Domain.Entities.ExecutionContext;
using SlamDunk.MES.Domain.IRepositories.Interfaces.ExecutionContext;
using System;
using System.Collections.Generic;
using System.Linq;

namespace SlamDunk.MES.Repository.Implements.ExecutionContext
{
    /// <summary>
    /// 工单参数要求仓储实现
    /// </summary>
    public class WorkOrderParameterAskRepository : EFEntityRepositoryProvider<WorkOrderParameterAsk>, IWorkOrderParameterAskRepository
    {
        #region # 获取工单参数要求列表 —— ICollection<WorkOrderParameterAsk> Find(Guid workOrderId)
        /// <summary>
        /// 获取工单参数要求列表
        /// </summary>
        /// <param name="workOrderId">工单Id</param>
        /// <returns>工单参数要求列表</returns>
        public ICollection<WorkOrderParameterAsk> Find(Guid workOrderId)
        {
            IQueryable<WorkOrderParameterAsk> parameterAsks = base.Find(x => x.WorkOrder.Id == workOrderId);

            return parameterAsks.ToList();
        }
        #endregion
    }
}
